package com.fengye.common.controller;

import com.fengye.common.constants.CommonConstant;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.servlet.http.HttpServletRequest;

/**
 * @author sunlei
 * @version 1.0
 * @date 2024/3/9 10:18:24
 * @description 处理过滤器抛出的异常
 */
@RestController
public class FilterErrorController {
    @RequestMapping(CommonConstant.FILTER_ERROR_CONTROLLER_PATH)
    public void handlerFilterException(HttpServletRequest request) throws Exception {
        throw (Exception) request.getAttribute(CommonConstant.FILTER_ERROR_EXCEPTION_KEY);
    }
}